//package com.guchenbo.flink;
//
//import org.apache.flink.api.common.eventtime.WatermarkStrategy;
//import org.apache.flink.streaming.api.datastream.DataStream;
//import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
//
//import java.time.Duration;
//import java.util.Arrays;
//
///**
// * @author guchenbo
// * @date 2024/6/10
// */
//public class HourDemo {
//    public static void main(String[] args) throws Exception {
//        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
//        env.setParallelism(2);
//
//        String s = "23 19 22 24 21 14 17 13 12 15 9 11 7 2 4";
//
//        WatermarkStrategy<Hour> strategy = WatermarkStrategy
//                        .<Hour>forBoundedOutOfOrderness(Duration.ofSeconds(20))
////                        .withTimestampAssigner((event, timestamp) -> event.timestamp);
//
//        DataStream<Hour> dataStream = env.fromElements(
//                        Arrays.stream(s.split(" ")).map(s1 -> new Hour(Integer.parseInt(s1))).toArray(Hour[]::new));
//
//
//
//        dataStream.print();
//        env.execute();
//    }
//}
